rm update
[EroBeats.git] / Djinn and Tonic - Erobeats / SettingsInit.cpp
blobe615df04c24ca580b6350a0bd2e5d1789d16b774
1 #include "SettingsInit.h"
5 SettingsInit::SettingsInit(FileIO* f, ResourceMaster* r)
7 fio = f;
8 rsc = r;
10 int settings = fio->loadUserData(3);
12 screenRes = (settings / 1000) % 10;
13 sfxVol = (settings / 100) % 10;
14 bgmVol = (settings / 10) % 10;
15 language = (settings / 1) % 10;
17 loadLangauges(language);
18 setSfxVol(sfxVol);
19 setBgmVol(bgmVol);
23 SettingsInit::~SettingsInit()
27 void SettingsInit::loadLangauges(int la) {
28 switch (la) {
29 case 1: fio->loadLanguage("Language/EN.txt"); break;
30 case 2: fio->loadLanguage("Language/FR.txt"); break;
31 case 3: fio->loadLanguage("Language/JP.txt"); break;
32 default: fio->loadLanguage("Language/EN.txt"); break;
35 void SettingsInit::setSfxVol(int vol) {
36 if (vol == 0) {
37 rsc->sptr->setVolume(2);
39 else {
40 rsc->sptr->setVolume(vol);
42 std::cout << vol << "SFX\n";
44 void SettingsInit::setBgmVol(int vol) {
45 if (vol == 0) {
46 rsc->bptr->setVolume(2);
48 else {
49 rsc->bptr->setVolume(vol);
51 std::cout << vol << "BGM\n";
53 int SettingsInit::getResolution() {
54 return screenRes;